// TemplateClassToTemplateClass.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

template <class PARATYPE>
class BaseTemplateClass
{
protected:
	PARATYPE m_basevalue;
public:
	PARATYPE getValue(){return m_basevalue;};
	void setValue(PARATYPE val){m_basevalue = val;};
	void addValue(PARATYPE addvalue);
};

template <class PARATYPE>
void BaseTemplateClass<PARATYPE>::addValue(PARATYPE addvalue)
{	
	m_basevalue += addvalue;
}

template <class PARATYPE>
class DrivedTemplateClass:public BaseTemplateClass<PARATYPE>
{
private:
	PARATYPE m_drivedvalue;
public:
	PARATYPE getDrivedValue(){return m_drivedvalue;};
	void setDrivedValue(PARATYPE val){m_drivedvalue = val;};
	void addDrivedValue(PARATYPE addvalue);
};

template <class PARATYPE>
void DrivedTemplateClass<PARATYPE>::addDrivedValue(PARATYPE addvalue)
{	
	m_drivedvalue += addvalue;
}

template <class PARATYPE,class PARATYPE2>
class DrivedTemplateClass2:public BaseTemplateClass<PARATYPE>
{
private:
	PARATYPE2 m_drivedvalue;
public:
	PARATYPE2 getDrivedValue(){return m_drivedvalue;};
	void setDrivedValue(PARATYPE2 val){m_drivedvalue = val;};
	void addDrivedValue(PARATYPE2 addvalue);
};

template <class PARATYPE,class PARATYPE2>
void DrivedTemplateClass2<PARATYPE,PARATYPE2>::addDrivedValue(PARATYPE2 addvalue)
{	
	m_drivedvalue += addvalue;
}

int main(int argc, char* argv[])
{
	BaseTemplateClass<int> a;

	DrivedTemplateClass<float> b;

	DrivedTemplateClass2<int,float> c;

	printf("Hello World!\n");
	return 0;
}

